﻿using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.ParallelArrays;
using FPA = Microsoft.ParallelArrays.FloatParallelArray;
using BPA = Microsoft.ParallelArrays.BoolParallelArray;
using IPA = Microsoft.ParallelArrays.IntParallelArray;
using PA = Microsoft.ParallelArrays.ParallelArrays;

namespace CoreCalc.SheetDefinedFunctions.Accellerator
{
    class AccCellRef : AccNumber
    {

        public readonly FullCellAddr cr;

        public AccCellRef(FullCellAddr c)
        { cr = c; }

        public override float Value
        {
            get
            {
                //Non numbercells could be evaluated to a recursive call or introduce other problems.
                if (cr.sheet[cr.ca] is CoreCalc.NumberCell)
                    return (float)(cr.sheet[cr.ca] as CoreCalc.NumberCell).value.value;
                throw new NotImplementedException("Cell Reference to non-NumberCell is not allowed on the GPU");
            }
            
        }

       

    }
}
